package com.ktjiaoyu.crm.config;

import com.ktjiaoyu.crm.filter.AuthorizationFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName : FilterConfig
 * @Description :
 * @Author : Lzz
 * @Date: 2023/11/17 10:38:02
 */
//@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean filterRegist() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new AuthorizationFilter());
        registration.setName("AuthorizationFilter");
        registration.addUrlPatterns("/main");//配置过滤规则，此处为了演示，仅拦截/main请求
        registration.setOrder(5);
        return registration;
    }

}
